home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / CShell⁄THINK C / !! CShell.Roadmap < prev    next >
Encoding:
Text File  |  1991-02-20  |  4.4 KB  |  122 lines  |  [TEXT/MPS ]

  1. CShell is broken up into a lot of files to (hopefully) make things easier for
  2. you to use.  We have tried to arrange the source files in a way that you can
  3. start making it into you application right away.  Of course, we realize that
  4. we can't think of everything here.  (That's why you are there.)  So if you
  5. have any suggestions to make CShell better, please don't be shy.
  6.  
  7.  
  8. Here's the organization of the source files:
  9.  
  10. CSHELL C CODE:  (Files you probably will need to change have are bulleted.)
  11.  
  12.     AppleEvents.c
  13. This file holds the core AppleEvents code.  There is a very useful function
  14. in this file called MakeTarget (by Keith Rollin).  This function creates
  15. a target descriptor for the AppleEvents, and it does it in a way that handles
  16. many of the variations, such as sending to yourself.  If you are going to
  17. use AppleEvents, you will like MakeTarget.
  18.  
  19. •    AppleEvents2.c
  20. This is the application-specific AppleEvents code.  The code for the custom
  21. AppleEvents is found here, as well as the code that targets a specific window,
  22. instead of a machine/application combination.
  23.  
  24. •    DoCursor.c
  25. This is the code for handling the cursor and for figuring out the cursor
  26. region for WaitNextEvent.  Simply replace this code with your application's
  27. cursor code.
  28.  
  29. •    DoEvent.c
  30. This is the code that dispatches for the different events.  Replace code
  31. as necessary for your application.
  32.  
  33.     EventLoop.c
  34. This code does next to nothing, and therefore most likely doesn't have to
  35. change, or doesn't need to change much.
  36.  
  37.     File.c
  38. This is a (kind-of) generic file I/O unit.  The code in this file probably
  39. doesn't have to change.  The functions that are application-specific are
  40. found in file2.c.
  41.  
  42. •    File2.c
  43. Here are the application-specific functions.  You will need to change these
  44. functions from the CShell samples to be specific to your task.
  45.  
  46. •    Help.c
  47. This is the balloon help code.  CShell supports dynamic balloon help in the
  48. content of the window.  This file just holds some sample code for balloon
  49. help in the window content.
  50.  
  51. •    IdleTasks.c
  52. Handle any NULL event tasks that you application has.  For CShell, this is
  53. when the balloon help code is called.
  54.  
  55.     Init.c
  56. This initialization code is separated from the rest of the application
  57. because it isn't supposed to have to change.  (Yea, right.)
  58.  
  59. •    Menu.c
  60. Application-specific menu code goes here.
  61.  
  62.     Print.c
  63. This print-loop code shouldn't have to change.  It sets up a global that
  64. the ImageDocument function can use to determine if it is printing or not.
  65. This global is the page number to be printed.  (If it is 0, then the
  66. application isn't printing.)  If the user wants all pages printed, the
  67. print-loop keeps sending ImageDocument incrementally larger page numbers
  68. to print.  ImageDocument is responsible for figuring out that there are no
  69. more pages to print.  When there are no more pages, just set gPrintPage
  70. to zero and return.  The print-loop won't call ImageDocument after that.
  71. (This print-loop code is ZZ approved, and may end up in the print-loop
  72. tech-note.)
  73.  
  74.     Start.c
  75. This is the code that gets the application going.  This is where you
  76. will find main().
  77.  
  78.     TextEditControl.c
  79. This is code for a TextEdit control.  The control can easily be added to a
  80. window, just like any other control.  The control handles clicks and key
  81. events.  It also handles scrolling, cut/copy/paste/clear, as well as undo.
  82. (I think you will like this code.)
  83.  
  84.     Utils.c
  85. This is a catch-all for useful things I didn't know where else to put.  You
  86. may like the code for key-equivalents for dialogs.  The key-equivalents are
  87. put in the resource fork, so they can be localized.
  88.  
  89.     Window.c
  90. This is where all the generic window code lives.
  91.  
  92. •    Window2.c
  93. This is where all the application-specific window code lives.  This is also
  94. where ImageDocument is located, which the print code calls.
  95.  
  96.  
  97. CSHELL ASSEMBLY CODE:
  98.  
  99. There is a little bit of assembly code needed for CShell.  Here are some
  100. descriptions of those files:
  101.  
  102.     TextEditControl.a
  103. This is the assembly code glue for the TextEdit control.
  104.  
  105.     View.cdef.a
  106. This is a little assembly code for a control definition.  It is just a cdef
  107. stub that jumps to the application code.  This is very useful for custom
  108. controls that need to call the rest of the application.
  109.  
  110.  
  111.  
  112. A useful file to look at is CShell.protos.  This is where all function
  113. prototypes can be found.  They are grouped based on source file, so you
  114. can use CShell.protos as a table of content (of sorts) to find various
  115. functions.
  116.  
  117.  
  118.  
  119. Happy Apps!
  120.  
  121. Eric Soldan
  122.